<!doctype html> 
<html> 
<head> 
    <meta charset="utf-8"> 
    <title></title> 
</head>
<body>
<script type="text/javascript">
	onload  = function(){
		for(var i = 0;i < 5;i++){
			if(i == 3)break;
			alert(i)
		}
	}
	
</script>
<input><input><input>

</body>
</html>